package com.hdcircles.autoform.util;

import android.app.ProgressDialog;

import com.hdcircles.autoform.R;
import com.hdcircles.autoform.app.App;

/**
 * Created by hdcircles on 2016/11/17.
 */

public class ProgressDialogUtil {

    private static ProgressDialog dialog;

    private static ProgressDialogUtil instance;

    public ProgressDialogUtil(){
        dialog=new ProgressDialog(App.getInstance(), R.style.AppTheme_Dark_Dialog);
    }

    public static void show(String msg){
        if (null==instance){
            instance=new ProgressDialogUtil();
        }
        dialog.setIndeterminate(true);
        dialog.setMessage(msg);
        dialog.show();
    }

    public static void close(){
        if (null!=dialog&&dialog.isShowing()){
            dialog.dismiss();
        }
    }

}
